#!/bin/bash

awk -F: 'BEGIN {

    print "List of Users"
    print "-------------------------------------------------------"
 
    printf "%-20s%-20s%-20s\n", "UserName", "Group ID", "Shell Path"
    print "-------------------------------------------------------"
}

{

    printf "%-20s%-20s%-20s\n", $1, $4, $7

    shell_count[$7]++
}

END {

    print "-------------------------------------------------------"
    print "Statistics:"


    for (shell in shell_count) {
        printf "Shell %s: %d\n", shell, shell_count[shell]
    }
}' /etc/passwd > awk1.out
